<?php
/**
 * Descript:自定义基类
 * User: blue
 * Date: 2018/9/10 18:40
 */

namespace app\library\except;


use app\library\enum\ErrDict;
use think\Exception;

class BaseException extends Exception
{
    public $code=400;
    public $message='用户行为异常';
    public $errCode=ErrDict::BASE_CUSTOM_ERROR;

    /**
     * BaseException constructor.
     * @param string|null $message 错误消息
     * @param int|null $errCode 错误代码
     * @param int|null $code http状态码
     */
    public function __construct(string $message=null,int $errCode=null,int $code=null)
    {
        if($code) $this->code=$code;
        if($message) $this->message=$message;
        if($errCode) $this->errCode=$errCode;
    }
}